#pragma once
#include "IManager.h"
#include <map>
#include <Windows.h>
#include <vector>
using namespace std;

class CLayer;
class CTile;

class CTileManager : public IManager
{
	//multimap<string, CLayer*> m_mmLayers;
	vector<CLayer*> m_vLayers;
	int m_nTileWidth;
	int m_nTileHeight;
	int m_nMapWidth;
	int m_nMapHeight;
	int m_nTileSetImage;
	int m_nLayerCount;

	////////////////////////////////////////////////////////////////////////////////////////
	//	Proper singleton:
	//	Constructor
	CTileManager();
	//	Trilogy of Evil:
	//		Copy constructor
	CTileManager(const CTileManager&);
	//		Assignment Operator
	CTileManager& operator=(const CTileManager&);
	//		Destructor
	~CTileManager();
	//
	////////////////////////////////////////////////////////////////////////////////////////

public:

	////////////////////////////////////////////////////////////////////////////////////////
	//	Accessors/Mutators
	int TileWidth() const { return m_nTileWidth; }
	void TileWidth(int val) { m_nTileWidth = val; }
	int TileHeight() const { return m_nTileHeight; }
	void TileHeight(int val) { m_nTileHeight = val; }
	int MapWidth() const { return m_nMapWidth; }
	void MapWidth(int val) { m_nMapWidth = val; }
	int MapHeight() const { return m_nMapHeight; }
	void MapHeight(int val) { m_nMapHeight = val; }
	int TileSetImage() const { return m_nTileSetImage; }
	void TileSetImage(int val) { m_nTileSetImage = val; }
	int LayerCount() const { return m_vLayers.size(); }
	vector<CLayer*> Layers() const { return m_vLayers; }
	void Layers(vector<CLayer*> val) { m_vLayers = val; }
	//
	////////////////////////////////////////////////////////////////////////////////////////

	static CTileManager* GetInstance();
	void Init();
	void Clear();
	void Shutdown();
	void Update(float fDelta);
	void Render();
	void AddLayer(CLayer* pLayer);
	void RemoveLayer(CLayer* pLayer);
	void AddTile(int nLayer, CTile *pTile);
};